<!--
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
   <title>vtiger CRM 5 - CustomerPortal</title>
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
   <link href="css/main.css" rel="stylesheet" type="text/css" />
   <?php
      // Prototype library clashes with AutoComplete library in use so avoid on those pages
      if($_REQUEST['fun'] != 'newticket') {
      	echo '<script language="javascript" type="text/javascript" src="js/prototype.js"></script>';
      }
   ?>
   <script language="javascript" type="text/javascript" src="js/general.js"></script>
   <script type="text/javascript">
      function fnMySettings(){
      		params = "last_login=<?php echo $_SESSION['last_login']; ?>&support_start_date=<?php echo $_SESSION['support_start_date']; ?>&support_end_date=<?php echo $_SESSION['support_end_date']; ?>";
      		window.open("MySettings.php?"+params,"MySettings","menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=400,height=400,left=550,top=200");
      }
   </script>
</head>
<body>
<div id="wrap"><!-- Begin wrapper -->
   <div id="header">
      <img src="images/loginVtigerCRM.gif" width="169" height="49" alt="vtiger CRM"/>
      <div>
         <span onclick="fnMySettings();" class="MySettingsHdr"><?php echo getTranslatedString('LBL_MY_SETTINGS');?></span>&nbsp;|&nbsp;
         <a href="index.php?logout=true" class="hdr"><?php echo getTranslatedString('LBL_LOG_OUT');?></a>
      </div>
   </div>
   <div id="main">
      <div id="contents">
         <div id="border">
            <div id="menu">
               <ul>
                  <?php
                     //FIXME - This really should be a function. It crops up in at least 4 places.
                     $showmodule = array();
                     // Look if we have the information already
                     if(isset($_SESSION['__permitted_modules'])) {
                        $showmodule = $_SESSION['__permitted_modules'];
                     } else {
                     // Get the information from server
                        $params = array();
                        $showmodule = $client->call('get_modules',$params,$Server_path,$Server_path);
                        // Store for further use.
                        $_SESSION['__permitted_modules'] = $showmodule;
                     }
                     for($i=0;$i<count($showmodule);$i++ ) {
                        echo '<li class="dvtUnSelectedCell" id="' . $showmodule[$i]. '" onclick="fnLoadValues(' . "'" . $showmodule[$i] . "'" . ')"><a href="index.php?module=' . $showmodule[$i]. '&amp;action=index&amp;onlymine=true">' .getTranslatedString($showmodule[$i]). '</a></li>' . "\n";
                     }
                  ?>
               </ul>
            </div>
            <!-- Break the page here and continue in a footer page to close -->
